package com.example.CarFee;

import com.example.trainfee.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class RegisterActivity extends Activity {
	private Button logging_btn, register_btn;
	private EditText account, password;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_register);
		logging_btn = (Button) findViewById(R.id.logging_btn);
		account = (EditText) findViewById(R.id.account);
		password = (EditText) findViewById(R.id.psw);
		logging_btn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				if (Service.zhuce(account.getText().toString(), password
						.getText().toString())) {
					Toast.makeText(RegisterActivity.this, "注册成功",
							Toast.LENGTH_SHORT).show();
					finish();
				} else {
					Toast.makeText(RegisterActivity.this, "注册失败，该账号已被注册",
							Toast.LENGTH_SHORT).show();
				}
			}
		});
	}
}
